package IOFlow.copy;

import java.io.FileInputStream;
import java.io.IOException;

public class CopyMany {
    public static void main(String[] args) throws IOException {
        /*
        public int read(byte[] buffer)      一次拷贝一个字节数组数据

        文件位置:
              C:\Users\35337\Desktop\Temporary\CopyTest.avi
         */

        FileInputStream fis=new FileInputStream("C:\\Users\\35337\\Desktop\\Temporary\\File\\Test.txt");

        //len:表示获取到的数量
        int len;
        //一次获取到的数据2个字节
        byte[] bytes=new byte[2];

        len=fis.read(bytes);
        System.out.println(new String(bytes,0,len));

        //多次书写len,需要对其进行刷新
        len=fis.read(bytes);
        System.out.println(new String(bytes,0,len));

        len=fis.read(bytes);
        System.out.println(new String(bytes,0,len));

        fis.close();
    }
}
